<template>
  <div class="workbench">
    <el-page-header @back="handleBack" content="工作台" />

    <div class="date-info">2025-11-14 星期五</div>

    <CoreIndicators :indicators="coreIndicators" />

    <StatsChart />

    <el-row :gutter="20" class="panel-row">
      <el-col :xs="24" :lg="12">
        <ApprovalPanel :approvalData="approvalData" />
      </el-col>
      <el-col :xs="24" :lg="12">
        <NoticePanel :notices="notices" />
      </el-col>
    </el-row>

    <OrderRemind :orders="orderReminds" />
  </div>
</template>

<script setup>
import CoreIndicators from "@/components/CoreIndicators.vue";
import StatsChart from "@/components/StatsChart.vue";
import ApprovalPanel from "@/components/ApprovalPanel.vue";
import NoticePanel from "@/components/NoticePanel.vue";
import OrderRemind from "@/components/OrderRemind.vue";
import {
  User,
  ShoppingCart,
  Money,
  Document,
  Download,
  Upload,
} from "@element-plus/icons-vue";

const coreIndicators = [
  { label: "今日销售收入(元)", value: "5000.00", icon: Money },
  { label: "今日销售订单量(笔)", value: "100", icon: Document },
  { label: "今日回款(元)", value: "5000.00", icon: Download },
  { label: "今日采购支出(元)", value: "5000.00", icon: Money },
  { label: "今日采购订单(笔)", value: "5000.00", icon: Document },
  { label: "今日已付款(元)", value: "5000.00", icon: Upload },
];

const approvalData = [
  { type: "采购订单", count: 0 },
  { type: "销售订单", count: 5 },
  { type: "入库单", count: 0 },
  { type: "出库单", count: 3 },
  { type: "到票单", count: 2 },
  { type: "支出单", count: 1 },
  { type: "开票单", count: 6 },
  { type: "请购单", count: 0 },
];

const notices = [
  { content: "春节放假通知", time: "2025-11-14 10:52:49" },
  { content: "五一放假通知", time: "2025-11-14 10:52:49" },
  { content: "端午节放假通知", time: "2025-11-14 10:52:49" },
  { content: "国庆放假通知", time: "2025-11-14 10:52:49" },
];

const orderReminds = [
  {
    orderNo: "XSDH2023512698",
    subject: "新产品销售0234",
    type: "销售订单",
    deliverDate: "2027-06-08",
  },
  {
    orderNo: "XSDH2023512698",
    subject: "新产品销售0234",
    type: "销售订单",
    deliverDate: "2027-06-08",
  },
  {
    orderNo: "XSDH2023512698",
    subject: "新产品销售0234",
    type: "销售订单",
    deliverDate: "2027-06-08",
  },
  {
    orderNo: "XSDH2023512698",
    subject: "新产品销售0234",
    type: "销售订单",
    deliverDate: "2027-06-08",
  },
];

const handleBack = () => {
  history.back();
};
</script>

<style scoped>
.workbench {
  padding: 16px;
}
.date-info {
  text-align: right;
  margin-bottom: 16px;
  color: #606266;
}
.panel-row {
  margin: 20px 0;
}
</style>
